package com.scuvc.service.impl;

import com.scuvc.entity.CategoryInfo;
import com.scuvc.service.CategoryInfoService;
import com.scuvc.utils.StaticUtils;

import java.util.List;

public class CategoryInfoServiceImpl implements CategoryInfoService {
    @Override
    public String[] getAllCategory() {
        List<CategoryInfo> list = StaticUtils.categoryInfoDao.getAllCategory();
        String[] cName = new String[list.size()];
        for(int i=0;i<list.size();i++){
            cName[i] = list.get(i).getCategory_name();
        }
        return cName;
    }

    @Override
    public Long getCategroyId(String categroy_name) {
        return StaticUtils.categoryInfoDao.getCategroyId(categroy_name);
    }
}
